<?php 

$entity = getInputArray("entity", $params, array());
$validate = str_replace(".","",str_replace(" ","",microtime()));

?>
<div class="abm_user">
	<form action="<?php echo WWWROOT;?>actions/admin/user/save.php" method="POST" enctype="multipart/form-data">
		<div>
			<input type="hidden" name="id" value="<?php echo $entity->attributes->id ?>"></input>
		</div>				
		<div class="benefit_edit_column">
		
			<div class='left'>
				<?php echo langEcho("email")?>
			</div>
			<div class='right'>
				<div class='benefitDivInputContainer rounded'>
					<?php echo loadView("input/email", array("name" => "email", "value" =>$entity->attributes->email, "required" => true, "validate" => $validate));?>		
				</div>		
			</div>		
		</div>		
	<?php if (!$entity->attributes->password){ ?>
		<div class="benefit_edit_column">
		
			<div class='left'>
				<?php echo langEcho("password")?><br />				
				<span class="duplicatePass" ><?php echo langEcho("passwordduplicated")?></span>
			</div>
			<div class='right'>
				<div class='benefitDivInputContainer rounded'>
					<?php echo loadView("input/password", array("name" => "password", "required" => true, "validate" => $validate));?>		
				</div>		
			</div>		
		</div>
			
		
	<?php }?>
		<div class="benefit_edit_column">
		
			<div class='left'>
				<?php echo langEcho("firstname")?>
			</div>
			<div class='right'>
				<div class='benefitDivInputContainer rounded'>
					<?php echo loadView("input/text", array("name" => "firstName", "value" =>$entity->attributes->getHTML("firstName"), "required" => true, "validate" => $validate));?>		
				</div>		
			</div>		
		</div>
		<div class="benefit_edit_column">
		
			<div class='left'>
				<?php echo langEcho("lastname")?>
			</div>
			<div class='right'>
				<div class='benefitDivInputContainer rounded'>
					<?php echo loadView("input/text", array("name" => "lastName", "value" =>$entity->attributes->getHTML("lastName"), "required" => true, "validate" => $validate));?>		
				</div>		
			</div>		
		</div>		
		<div class="clearFloat"></div>
		<div class="benefit_edit_column">		
			<div class='left'>
				<?php echo langEcho("admin");?>
			</div>
			<div class='right'>
				<div class='benefitDivInputContainer rounded'>
					<?php
						if ($entity->attributes->admin) 
							$checked = "checked";
						else
							$checked="";

						echo loadView("input/checkbox", array("name" => "admin", "checked" => $checked));	
					?>
					
				</div>
			</div>		
		</div>					
		<div class="benefit_edit_column">		
			<div class='left'>
				<?php echo langEcho("active");?>
			</div>
			<div class='right'>
				<div class='benefitDivInputContainer rounded'>
					<?php
						if ($entity->attributes->active) 
							$checked = "checked";
						else
							$checked="";

						echo loadView("input/checkbox", array("name" => "active", "checked" => $checked));	
					?>
					
				</div>
			</div>		
		</div>		
		<div>
			<?php echo loadView("input/submit", array("value" =>langEcho("save"), "validate" => $validate));?>
		</div>
	</form>
</div>